<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<chiptrack:checkLogon sourcePage="/salesReport.do?action=shippingreport" />
<%@ page import="com.scalar.chiptrack.utils.ConfigManager"%>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>



<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/validations.js">
<SCRIPT language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/functions.js">
</script>
<SCRIPT language="JavaScript">
    var dateElement = "";
    function openCalendar(dateValue)
    {
	    dateElement = dateValue;
  	    newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
  	    newWindow.moveTo(550,180);
  	    newWindow.focus();
    }
	function assignDate(passedValue)
    {
	    dateElement.value=passedValue;
	    window.focus();
    }
    function validateDates()
    {
        errMsg = '';
        var pa	= document.getElementById("errors")
        if(chkDate(document.rmaReport.datefrom.value,'From-Date','N') == false)
        {
            pa.innerHTML = errMsg;
            document.rmaReport.datefrom.focus();
            return false;
        }

        if(chkDate(document.rmaReport.dateto.value,'To-Date','N') == false)
        {
            pa.innerHTML = errMsg;
            document.rmaReport.dateto.focus();
            return false;
        }

        if(document.rmaReport.datefrom.value!='' && document.rmaReport.dateto.value!='')
        {
            if (CompareDate(document.rmaReport.datefrom.value,document.rmaReport.dateto.value) == false )
            {
                pa.innerHTML = "To Date cannot be less than From Date";
                document.rmaReport.dateto.focus();
                return false;
            }
        }

        return true;
    }
    function dateRange(){

    var period="";
    var cat="";

    var d = new Date();
		var day   = d.getDate();
		var month = d.getMonth()+1;
		var year  = d.getFullYear();
		var hour  = d.getHours();
		var min   = d.getMinutes();
		var sec   = d.getSeconds();

		var defaultPrompt = day+"/"+month+"/"+year+":"+hour+":"+min+":"+sec;


<%--    //added by varma(29jun2004) to validate from and to dates--%>
<%--    var errors = "";--%>
<%--    temp = document.rmaReport["dateto"];--%>
<%--    if( chkDate(document.rmaReport["dateto"].value,"","Y") && chkDate(temp.value,"","N") && document.rmaReport["dateto"].value != '' )--%>
<%--    {--%>
<%--            if( CompareDate( document.rmaReport["datefrom"].value, document.rmaReport["dateto"].value ) == false )--%>
<%--            {--%>
<%--            errors = errors + " To Date Cannot be less than From Date";--%>
<%--            var pa = document.getElementById("errors");--%>
<%--		    pa.innerHTML = errors+'<p>';--%>
<%--            temp.select();--%>
<%--            temp.focus();--%>
<%--            }--%>
<%--	}--%>
<%--   // till here additions of varma--%>
        var success;
        success = true;
        success = validateDates();
		if(success == false)
        {
           return false;
        }

    if (document.rmaReport.products.value == '' )
    	document.rmaReport.prompt0.value = '0';
    else
    	document.rmaReport.prompt0.value  = document.rmaReport.products.value;

    if (document.rmaReport.customers.value == '' )
	    document.rmaReport.prompt1.value = '0';
    else
	    document.rmaReport.prompt1.value  = document.rmaReport.customers.value;

    if (document.rmaReport.datefrom.value == '' )
	    document.rmaReport.prompt2.value = '0';
    else
	    document.rmaReport.prompt2.value  = document.rmaReport.datefrom.value;

    if (document.rmaReport.dateto.value == '' )
	    document.rmaReport.prompt3.value = '0';
    else
    	document.rmaReport.prompt3.value  = document.rmaReport.dateto.value;

	if (document.rmaReport.category.value == '' )
	    document.rmaReport.prompt4.value = '0';
    else
    	document.rmaReport.prompt4.value  = document.rmaReport.category.value;

	if (document.rmaReport.status.value == '' )
	    document.rmaReport.prompt5.value = '0';
    else
    	document.rmaReport.prompt5.value  = document.rmaReport.status.value;

    document.rmaReport.prompt6.value = defaultPrompt;

    document.rmaReport.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Sales/Shipped/RMA_REPORT.rpt";

	//added by varma(29jun2004)
    if(errors == ''){
       document.rmaReport.submit();
    }
}
</script>
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<form name =rmaReport method="post">

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<input type="hidden" name="prompt0">
<input type="hidden" name="prompt1">
<input type="hidden" name="prompt2">
<input type="hidden" name="prompt3">
<input type="hidden" name="prompt4">
<input type="hidden" name="prompt5">
<input type="hidden" name="prompt6">

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->
<%@ include file="/jsp/sales/rma_menu.jsp" %>
<!-- end of the side navigations -->

<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>

<!-- from here your body starts -->

<center><span class="NArialW">RMA Reports</span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>

  <table border="0" width="90%" align=right>
    <%--Added by varma(29 jun 2004) to display validation msg of dates --%>
    <tr>
    	<td  colspan="6" align="left" class='NArialL'><FONT face="Verdana" size="-5" id="errors" styleClass="NArialL" color='FF0000'></FONT></td>
    </tr>
    <tr>
        <td width="15%"><font class="NArialL">From-Date</font></td>
        <td width="20%"><font class="NArialL">
            <input type="text" name="datefrom" size="20" class="txfield"></font>&nbsp;
            <a href="javascript:openCalendar(document.rmaReport.datefrom)"onmouseover="window.status='Click to Select From Date';return true"onmouseout="window.status='';return true"title="Click here to Select From Date">
            <img border="0" src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=18 width=18></a>
        </td>
        <td width="5%">&nbsp;</td>
        <td width="15%"><font class="NArialL">To-Date</font></td>
        <td width="20%"><font class="NArialL">
            <input type="text" name="dateto" size="20" class="txfield"></font>&nbsp;
            <a href="javascript:openCalendar(document.rmaReport.dateto)"onmouseover="window.status='Click to Select To Date';return true"onmouseout="window.status='';return true"title="Click here to Select To Date">
            <img border="0" src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=18 width=18></a>
        </td>
        <td width="15%">&nbsp;</td>
    </tr>

    <tr height="5">
        <td width="15%"></td>
        <td width="20%"></td>
        <td width="5%" ></td>
        <td width="15%"></td>
        <td width="20%"></td>
        <td width="15%"></td>
    </tr>

    <tr>
        <td width="15%"><font class="NArialL">Customer</font></td>
        <td width="20%"><font class="NArialL">
            <select size="1" name="customers" class="txfield">
                <!-- <option value="0">All Customers</option> -->
                <logic:iterate id="customerSelectList" name="customerSelectList">
	                <logic:notEqual name="customerSelectList" value="null">
                        <option value = <bean:write name="customerSelectList" property="value"/>>
                            <bean:write name="customerSelectList" property="label"/>
                        </option>
                    </logic:notEqual>
                </logic:iterate>
            </select>
        </td>
        <td width="5%">&nbsp;</td>
        <td width="15%"><font class="NArialL">Product</font></td>
        <td width="20%"><font class="NArialL">
            <select size="1" name="products" class="txfield">
                <option value="0">All Products</option>
                <logic:iterate id="mktgPartNumberSelectList" name="mktgPartNumberSelectList">
	                <logic:notEqual name="mktgPartNumberSelectList" value="null">
                        <option value = "<bean:write name="mktgPartNumberSelectList" property="productId"/>">
                            <bean:write name="mktgPartNumberSelectList" property="manufacturingPartNo"/>
                        </option>
                    </logic:notEqual>
                </logic:iterate>
            </select>
        </td>
        <td width="15%">&nbsp;</td>
    </tr>
    <tr>
        <td width="15%"><font class="NArialL">Category</font></td>
        <td width="20%"><font class="NArialL">
            <select size="1" name="category" class="txfield">
                <option value="0">All</option>
                <option value="E">Exchange</option>
                <option value="C">Credit</option>
                <option value="F">FA</option>
            </select>
        </td>
        <td width="5%">&nbsp;</td>
        <td width="15%"><font class="NArialL">Status</font></td>
        <td width="20%"><font class="NArialL">
            <select size="1" name="status" class="txfield">
                <option value="0">All</option>
                <option value="ISSUED">ISSUED</option>
                <option value="CLOSE">CLOSE</option>
                <option value="CANCELLED">CANCELLED</option>
            </select>
        </td>
        <td width="15%">&nbsp;</td>
    </tr>

    <tr>
        <td colsapn=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td>
    </tr>

	<tr>

<%--        <a href="javascript:dateRange()"onmouseover="window.status='Click to Generate RMA Report';return true"onmouseout="window.status='';return true"title="Click here to Generate RMA Report"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" width="53" height="17"></a>--%>
<%--        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--%>
            <td colspan=5 align=center><input type="image" onClick="javascript:return dateRange();" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" width="53" height="17" onmouseover="window.status='Click to Generate Report';return true"onmouseout="window.status='';return true"title="Click here to Generate Report">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <%-- <img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17"onmouseover="window.status='Click to Cancel';return true"onmouseout="window.status='';return true"title="Click here to Cancel"> --%>
        <%--Modified by varma(29 jun 2004) --%>
        <a href="javascript:document.rmaReport.reset();"><img src="<%=chipTracContext%>/jsp/includes/images/reset.gif" border='0' onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true"title="Click here to Reset"></a>
        </td>
    </tr>
  </table>

<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</form>
</BODY>
</HTML>
